<!DOCTYPE html>
<html>
<head>
	<title>选择封面</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/photoNewBook/jisuan.js"></script>
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="yes" name="apple-touch-fullscreen">
	<meta content="telephone=no,email=no" name="format-detection">
	<meta content="telephone=no,email=no" name="format-detection">
	<link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/common.css?v={$WST_V}">
   <link rel="stylesheet" type="text/css" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/photoNewBook/templet.css"/>
   <link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/photo_edit.css" type="text/css">
	<include file="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/common_js.html" />
   <style type="text/css">
   	.Editcontent{
   		border: none;
   		color: #000000;
   	}
   	#thread_boundbook{
   		color: #79E6D5;
    border-bottom: 1px solid #79E6D5;
   	}
   </style>
</head>

<body>
		<input id="pbId" type="hidden" value="{$pbId}">
	<div class="container">
			<div class="main">
					<div class="main_cover">
					<div class="cover">
						<div class="coverTop">
							<div class="coverNav">选择封面对封面对编辑将会实时生效哦</div>
							<div class="bookName">
								<span class="book_name left">作品书名</span>
								<input type="text" name="" class="inputName right" placeholder="请输入作品书名" value="{$pbook.bookName}" id="bookName" maxlength="9">
							</div>
							<div class="biaoName">
								<span class="biao_name left">作者</span>
								<input type="text" name="" class="inputbiao right" placeholder="请输入副标题或者作者名字" value="{$pbook.title}" id="title" maxlength="8">
							</div>

						</div>
						<div class="coverBot">
							<div class="coverImg">
								<div class="xuanze">选择封面</div>
								<div class="coverStyle">
									<volist name="photoCover" id="vo" offset="0" length='3' key="k">
										<div class="cover_style left left_{$k}">
											<div class="cover_style_img"><img src="http://www.youyiku-yishu.cn/{$vo.image}" class="img">
											</div>
											<if condition="$pbook.coverId eq $vo['id']">
												<div class="cover_style_top" data="{$vo.id}">
													<else/>
													<div class="cover_style_top" data="{$vo.id}">

											</if>
											<if condition="$pbook.coverId eq $vo['id']"><div class="coverTure cover_cur" data="{$vo.id}">
												<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/photo_book_edit_the_cover_selected_cover_icon_sel.png" class="img">
											</div><else/><div class="coverTure" data="{$vo.id}">
												<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/photo_book_edit_the_cover_selected_cover_icon_sel.png" class="img">
											</div></if>

										</div>
								</div>
								</volist>
							</div>
							<volist name="photoCover" id="vs">
								<if condition="$vs['cId'] eq $photoCover[0]['cId']"><if condition="$vs['pbId'] eq $pbId">
									<input type="hidden" value="{$vs['image']}" id="imagebox1">
									<input type="hidden" value="{$vs['shape']}" id="imageboxShape1">
								</if></if>

								<if condition="$vs['cId'] eq $photoCover[1]['cId']"><if condition="$vs['pbId'] eq $pbId">
									<input type="hidden" value="{$vs['image']}" id="imagebox2">
									<input type="hidden" value="{$vs['shape']}" id="imageboxShape2">
								</if></if>

								<if condition="$vs['cId'] eq $photoCover[2]['cId']"><if condition="$vs['pbId'] eq $pbId">
									<input type="hidden" value="{$vs['image']}" id="imagebox3">
									<input type="hidden" value="{$vs['shape']}" id="imageboxShape3">
								</if></if>
							</volist>
						</div>
					</div>
				</div>
			</div>
	    </div>
	</div>
	<div class="shade3"></div>
	<div class="bullet1">
		<div class="bullet-text">是否删除本页</div>
		<div class="bullet-quxiao">取消</div>
		<div class="bullet-queding">确定</div>
	</div>
		<input type="hidden" id="coverId" value="{$pbook['coverId']}">
		<!-- 微信跨域传图片用access-->
		<input type="hidden" id="accessToken" value="{$accessToken}">
	<foot>
		<div class="Foot">
				<div class="Editcontent boundbook" id="Editcontent">编辑内容</div>
				<div class="thread-boundbook" id="thread_boundbook">编辑封面</div>
			 	<div class="accomplish" id="accomplish">预览书本</div>
		</div>
	</foot>
</body>
<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/photoNewBook/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/photoNewBook/ajax.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script type="text/javascript">
    var WST = ThinkPHP = window.Think = {
            "ROOT"   : "__ROOT__",
            "APP"    : "__APP__",
            "PUBLIC" : "__PUBLIC__",
            "DEEP"   : "{:C('URL_PATHINFO_DEPR')}",
            "MODEL"  : ["{:C('URL_MODEL')}", "{:C('URL_CASE_INSENSITIVE')}", "{:C('URL_HTML_SUFFIX')}"],
            "VAR"    : ["{:C('VAR_MODULE')}", "{:C('VAR_CONTROLLER')}", "{:C('VAR_ACTION')}"],
            "DOMAIN" : "{:WSTDomain()}",
            "CITY_ID" : "{$currArea['areaId']}",
            "CITY_NAME" : "{$currArea['areaName']}",
            "DEFAULT_IMG": "{:WSTDomain()}/{$CONF['goodsImg']}",
            "MALL_NAME" : "{$CONF['mallName']}",
            "SMS_VERFY"  : "{$CONF['smsVerfy']}",
            "PHONE_VERFY"  : "{$CONF['phoneVerfy']}",
            "IS_LOGIN" :"{$WST_IS_LOGIN}",
            "WST_STYLE" :"{$WST_STYLE}"
        }
</script>
<script>
    wx.config({
        debug: false,
        appId: '<?php echo $signPackage["appId"];?>',
        timestamp:'<?php echo $signPackage["timestamp"];?>',
        nonceStr: '<?php echo $signPackage["nonceStr"];?>',
        signature: '<?php echo $signPackage["signature"];?>',
        jsApiList: [
            // 所有要调用的 API 都要加到这个列表中
            'startRecord','stopRecord','translateVoice','uploadVoice','chooseImage','previewImage','uploadImage','getLocalImgData'
        ]
    });
</script>
<include file="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/common_js.html" />
<script src="http://www.youyiku-yishu.cn/Public/js/think.js"></script>
<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/photoNewBook/titlpage.js"></script>
<script>
	window.onload=function(){
		window.onload=function(){
	Cookies.get('userId'); // => 'value'
	var userId=Cookies.get('userId');
    var pbId=Cookies.get('pbId');	
    
//获取所有cookie
Cookies.get(); // => { name: 'value' }
	var suerId=576;
	var pbId=1787;
		 $.ajax({
		    type:"POST",
		    url:"http://www.youyiku-yishu.cn/WebApp/AppPhotoBooks/coverpaper",
		    data:{pbId:pbId,userId:userId},
		    dataType:"json",
		       beforeSend: function (XMLHttpRequest) {
		         		XMLHttpRequest.setRequestHeader("DEVICEINFO", "JxRaZezavm3HXM3d9pWnYiqqQC1SJbsU");
		       }
		  }).then(data=>{
				  	console.log(data);
		  	   
		    		   var style=(data.style);	    		
		        		$("head").append("<link>");
   						 css = $("head").children(":last");
   						   css.attr({
					        rel: "stylesheet",
					        type: "text/css",
					        href:"http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/photoNewBook/coverpaper"+style+".css"
					    });
					    
					    $.getScript("../js/photoNewBook/parentOffspring"+style+".js",function(){
							});
		
		    });
	
}
	}
	
</script>
</html>

